/*
 *      主界面
 */

#ifndef KITHARANETWORK_MAINWIDGET_H
#define KITHARANETWORK_MAINWIDGET_H

#include <QWidget>
#include "Business/BusinessThread.h"

QT_BEGIN_NAMESPACE
namespace Ui
{
    class MainWidget;
}
QT_END_NAMESPACE

class MainWidget final : public QWidget {
Q_OBJECT

public:
    explicit MainWidget(QWidget *parent = nullptr);

    ~MainWidget() override;

protected:

    bool eventFilter(QObject *obj, QEvent *event) override;

private:
    /* 初始化 */
    void Init();

    /* 连接信号槽 */
    void OnConnect();

private Q_SLOTS:
    /* 按钮点击 */
    void OnHomeButtonClicked(bool check) const;

    void OnDataButtonClicked(bool check) const;

    void OnSetButtonClicked(bool check) const;

    void OnStartServer(bool check) const;

private:
    Ui::MainWidget *ui;
    BusinessThread* business_thread_{nullptr};           /* 业务线程 */
};


#endif //KITHARANETWORK_MAINWIDGET_H
